package java1226;

public class Teacher {
    String name;
    int age;

    public Teacher() {
    }

    public Teacher(String name, int age) {

        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Teacher{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public static void main(String[] args) {
        Teacher t1 = new Teacher();
        t1.setName("李奇隆");
        t1.setAge(99);
        System.out.println(t1);

        Teacher t2 = new Teacher("孙旭",66);
        System.out.println(t2);
    }
}

